package com.yl.ydk.ui.adapter

import com.yl.ydk.R
import com.yl.ydk.bean.TestPapersBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder


class TestPapersAdapter(data: MutableList<TestPapersBean.DataX>?) :
    BaseQuickAdapter<TestPapersBean.DataX, BaseViewHolder>(
        R.layout.item_test_papers,
        data
    ) {

    override fun convert(helper: BaseViewHolder?, item: TestPapersBean.DataX?) {
        helper?.let {
            it.setText(R.id.tvName, item?.title)
            it.itemView.setOnClickListener {
                onItemClick?.onListItemClick(item)
            }
        }
    }

    private var onItemClick: onListItemClick? = null

    interface onListItemClick {
        fun onListItemClick(item: TestPapersBean.DataX?)
    }

    fun onListItemClick(onListItemClick: onListItemClick?) {
        this.onItemClick = onListItemClick
    }


}
